package com.mashibing.test.case18;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class Dog {
	private Cat cat;

	public Dog() {
		System.out.println("1");
	}

	//@Autowired
	public Dog(@Qualifier("cat01") Cat cat) {
		this.cat = cat;
		System.out.println("2");
	}

	@Autowired(required = true)
	public Dog(Cat cat01,Cat cat02) {
		this.cat = cat01;
		System.out.println("3");
	}

	@Override
	public String toString() {
		return "Dog{" +
				"cat=" + cat +
				'}';
	}
}
